package com.isoft.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.isoft.domain.SysUser;

public interface SysUserDao extends PagingAndSortingRepository<SysUser, Integer> {

	SysUser findBySysUserName(String userName);

	SysUser findBySysUserId(Integer id);

	@Query("from SysUser a where a.sysUserAge = :age")
	public Page<SysUser> findBySysUserAge(@Param("age") Integer age,Pageable pageable);

	@Query("select a from SysUser a where a.sysUserAge < ?1")
	public Page<SysUser> findBySysUserAgeLessThan(Integer age,Pageable pageable);

	@Query("select a from SysUser a where a.sysUserAge > ?1")
	public Page<SysUser> findBySysUserAgeGreaterThan(Integer age, Pageable pageable);

}
